//
//  WKAppObjectManager.m
//  ourToken
//
//  Created by wakeup on 2018/6/28.
//  Copyright © 2018年 ourtoken. All rights reserved.
//

#import "WKAppObjectManager.h"

@implementation WKAppObjectManager

+ (CGFloat)sizeHeightWithFont:(UIFont *)font maxW:(CGFloat) maxW withContent:(NSString *)testStr {
    NSDictionary *textAttrs = @{NSFontAttributeName : font};
    CGSize size = CGSizeMake(maxW, MAXFLOAT);
    return [testStr boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:textAttrs context:nil].size.height;
}

+ (CGFloat)sizeWidthWithFont:(UIFont *)font maxW:(CGFloat) maxW withContent:(NSString *)testStr {
    NSDictionary *textAttrs = @{NSFontAttributeName : font};
    CGSize size = CGSizeMake(maxW, MAXFLOAT);
    return [testStr boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:textAttrs context:nil].size.width;
}

@end
